package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * ApArticle
 *
 * @author liudo
 * @version 1.0
 * @project heima-leadnews
 * @date 2023/10/30 10:42:06
 */
@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {
    /**
     * 选择页面限制
     *
     * @param pageQuery      页面查询
     * @param apArticleQuery ap文章查询
     * @return {@link Page}<{@link ApArticle}>
     */
    Page<ApArticle> selectPageLimit(Page<ApArticle> pageQuery, @Param("apArticleQuery") ApArticle apArticleQuery);

    /**
     * 在pulish时间限制之前选择页面
     *
     * @param pageQuery      页面查询
     * @param apArticleQuery ap文章查询
     * @return {@link Page}<{@link ApArticle}>
     */
    Page<ApArticle> selectPageBeforePulishTimeLimit(Page<ApArticle> pageQuery,@Param("apArticleQuery") ApArticle apArticleQuery);

    /**
     * pulish时间限制后选择页面
     *
     * @param pageQuery      页面查询
     * @param apArticleQuery ap文章查询
     * @return {@link Page}<{@link ApArticle}>
     */
    Page<ApArticle> selectPageAfterPulishTimeLimit(Page<ApArticle> pageQuery, ApArticle apArticleQuery);
}
